<?php
namespace app\admin\controller;
class Notice 
{
	public function __construct(){
		Admin_auth();
	}
	
    public function index()
    {
		$data = db("notice")->select();
        return view('',['data'  => $data]);
    }
	
	public function edit()
    {
		$id = input("get.id")?input("get.id"):0;
		$data = array();
		if(request()->isPost()){
			$data = input("post.");
			db("notice")->where(['id' => $id])->update($data);
			$data['id'] = $id;
		}else{
			$data = db("notice")->where(['id' => $id])->find();
		}
        return view('',['data'  => $data]);
    }
	
}
